from django.contrib import admin
from django.urls import path, include  # 导入 include 函数
from django.conf import settings
from django.conf.urls.static import static
from django.views.generic.base import RedirectView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('accounts/', include('accounts.urls')),
    path('music/', include('music.urls')),
    path('guitar/', include('Guitar.urls')),
    path('card/', include('card_app.urls')),
    # 将根 URL 重定向到 /account/index/
    path('', RedirectView.as_view(url='/accounts/index/', permanent=False)),
]

if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
